#include<iostream>
#include<set>
using namespace std;
int main(){
	set<int>a;
	int b,n;
	cin>>n;
	while(n--){
		cin>>b;
		a.insert(b);
	}
	cout<<a.size()<<endl;
	set<int>::iterator it=a.begin();
	cout<<(*it);it++;
	for(;it!=a.end();++it){
		cout<<" "<<(*it);
	}
	return 0;
}